Inside Macintosh: QuickTime Components

Previous | Chapter Top | Chapter Contents | Next

Controlling Analog Video

Some video digitizer components may provide functions that allow applications to control the characteristics of the input analog video signal. This section describes these analog video functions.

The VDGetVideoDefaults function returns the suggested default values for the analog video parameters that can be affected by functions described in this section.

A number of functions affect gamma correction. The VDSetInputGammaRecord and VDGetInputGammaRecord functions work with gamma structures (see Designing Cards and Drivers for the Macintosh Family , third edition, for more information about gamma structures). You can use the VDSetInputGammaValue and VDGetInputGammaValue functions to allow your application to set particular gamma values.

The VDSetBlackLevelValue , VDGetBlackLevelValue , VDSetWhiteLevelValue , and VDGetWhiteLevelValue functions allow applications to work with black levels and white levels in the source video. Black level refers to the degree of blackness in an image. This is a common setting on a video digitizer. The highest setting produces an all-black image; on the other hand, the lowest setting yields little, if any, black even with black objects in the scene. Black level is a significant setting because it can be adjusted so that there is little or no noise in an image. White level refers to the degree of whiteness in an image. It is also a common video digitizer setting.

The VDSetContrast , VDGetContrast , VDSetSharpness , and VDGetSharpness functions allow applications to work with contrast and sharpness values in the source video. The VDGetBrightness and VDSetBrightness functions allow applications to work with the image brightness setting.

The VDSetHue , VDGetHue , VDSetSaturation , and VDGetSaturation functions allow applications to work with hue and saturation settings in the source video.

VDGetVideoDefaults

The VDGetVideoDefaults function returns the recommended values for many of the analog video parameters that may be set by applications.

All video digitizer components must support this function.

pascal VideoDigitizerError VDGetVideoDefaults
                                         (VideoDigitizerComponent ci,
                                          unsigned short *blackLevel,
                                          unsigned short *whiteLevel,
                                          unsigned short *brightness,
                                          unsigned short *hue,
                                          unsigned short *saturation,
                                          unsigned short *contrast,
                                          unsigned short *sharpness);
ci
Specifies the video digitizer component for the request. Applications obtain this reference from the Component Manager's OpenComponent function.
blackLevel
Contains a pointer to an integer that is to receive the default black level value. The video digitizer component places the default black level value into the field referred to by this parameter. Refer to the discussion of the VDSetBlackLevelValue function in the next section for more information about black level values.
whiteLevel
Contains a pointer to an integer that is to receive the default white level value. The video digitizer component places the default white level value into the field referred to by this parameter. Refer to the discussion of the VDSetWhiteLevelValue function on VDSetWhiteLevelValue for more information about white level values.
brightness
Contains a pointer to an integer that is to receive the default brightness value. The video digitizer component places the default brightness value into the field referred to by this parameter. Refer to the discussion of the VDSetBrightness function on VDSetBrightness for more information about brightness values.
hue
Contains a pointer to an integer that is to receive the default hue value. The video digitizer component places the default hue value into the field referred to by this parameter. Refer to the discussion of the VDSetHue function on VDSetHue for more information about hue values.
saturation
Contains a pointer to an integer that is to receive the default saturation value. The video digitizer component places the default saturation value into the field referred to by this parameter. Refer to the discussion of the VDSetSaturation function on VDSetSaturation for more information about saturation values.
contrast
Contains a pointer to an integer that is to receive the default contrast value. The video digitizer component places the default contrast value into the field referred to by this parameter. Refer to the discussion of the VDSetContrast function on VDSetContrast for more information about contrast values.
sharpness
Contains a pointer to an integer that is to receive the default sharpness value. The video digitizer component places the default sharpness value into the field referred to by this parameter. Refer to the discussion of the VDSetSharpness function on VDSetSharpness for more information about sharpness values.

RESULT CODE

noErr

0

No error

VDSetBlackLevelValue

The VDSetBlackLevelValue function sets the current black level value. Black level values range from 0 to 65,535, where 0 represents the maximum black value and 65,535 represents the minimum black value.

pascal VideoDigitizerError VDSetBlackLevelValue
                                          (VideoDigitizerComponent ci,
                                          unsigned short *blackLevel);
ci
Specifies the video digitizer component for the request. Applications obtain this reference from the Component Manager's OpenComponent function.
blackLevel
Contains a pointer to an integer that contains the new black level value. The video digitizer component attempts to set the black level value to the value specified by this parameter. The digitizer component returns the new value, so that the application can avoid using unsupported values in future requests.

RESULT CODES

noErr

0

No error

digiUnimpErr

-2201

Function not supported

qtParamErr

-2202

Invalid parameter value

SEE ALSO

Applications can get the current black level value by calling the VDGetBlackLevelValue function (described in the next section). Applications can obtain the recommended black level value by calling the VDGetVideoDefaults function (described in the previous section).

VDGetBlackLevelValue

The VDGetBlackLevelValue function returns the current black level value. Black level values range from 0 to 65,535, where 0 represents the maximum black value and 65,535 represents the minimum black value.

pascal VideoDigitizerError VDGetBlackLevelValue
                                          (VideoDigitizerComponent ci,
                                         unsigned short *blackLevel);
ci
Specifies the video digitizer component for the request. Applications obtain this reference from the Component Manager's OpenComponent function.
blackLevel
Contains a pointer to an integer that is to receive the current black level value. The video digitizer component places the black level value into the field referred to by this parameter.

DESCRIPTION

Applications can set the black level value by calling the VDSetBlackLevelValue function (described in the previous section). Applications can obtain the recommended black level value by calling the VDGetVideoDefaults function (described on VDGetVideoDefaults ).

RESULT CODES

noErr

0

No error

digiUnimpErr

-2201

Function not supported

VDSetWhiteLevelValue

The VDSetWhiteLevelValue function sets the white level value. White level values range from 0 to 65,535, where 0 represents the minimum white value and 65,535 represents the maximum white value.

pascal VideoDigitizerError VDSetWhiteLevelValue
                                          (VideoDigitizerComponent ci,
                                          unsigned short *whiteLevel);
ci
Specifies the video digitizer component for the request. Applications obtain this reference from the Component Manager's OpenComponent function.
whiteLevel
Contains a pointer to an integer that contains the new white level value. The video digitizer component attempts to set the white level value to the value specified by this parameter. The digitizer component returns the new value, so that the application can avoid using unsupported values in future requests.

RESULT CODES

noErr

0

No error

digiUnimpErr

-2201

Function not supported

qtParamErr

-2202

Invalid parameter value

SEE ALSO

Applications can get the current white level value by calling the VDGetWhiteLevelValue function (described in the next section). Applications can obtain the recommended white level value by calling the  VDGetVideoDefaults  function (described on VDGetVideoDefaults ).

VDGetWhiteLevelValue

The VDGetWhiteLevelValue function returns the current white level value. White level values range from 0 to 65,535, where 0 represents the minimum white value and 65,535 represents the maximum white value.

pascal VideoDigitizerError VDGetWhiteLevelValue
                                          (VideoDigitizerComponent ci,
                                          unsigned short *whiteLevel);
ci
Specifies the video digitizer component for the request. Applications obtain this reference from the Component Manager's OpenComponent function.
whiteLevel
Contains a pointer to an integer that is to receive the current white level value. The video digitizer component places the white level value into the field referred to by this parameter.

RESULT CODES

noErr

0

No error

digiUnimpErr

-2201

Function not supported

SEE ALSO

Your application can set the white level value by calling the VDSetWhiteLevelValue function (described in the previous section). Your application can obtain the recommended white level value by calling the VDGetVideoDefaults function (described on VDGetVideoDefaults ).

VDSetHue

The VDSetHue function sets the current hue value. Hue is similar to the tint control on a television, and it is specified in degrees with complementary colors set 180 degrees apart (red is 0°, green is +120°, and blue is -120°). Video digitizer components support hue values that range from 0 (-180° shift in hue) to 65,535 (+179° shift in hue), where 32,767 represents a 0° shift in hue.

pascal VideoDigitizerError VDSetHue (VideoDigitizerComponent ci,
                                          unsigned short *hue);
ci
Specifies the video digitizer component for the request. Applications obtain this reference from the Component Manager's OpenComponent function.
hue
Contains a pointer to an integer that contains the new hue value. The video digitizer component attempts to set the hue value to the value specified by this parameter. The digitizer component returns the new value, so that the application can avoid using unsupported values in future requests.

RESULT CODES

noErr

0

No error

digiUnimpErr

-2201

Function not supported

qtParamErr

-2202

Invalid parameter value

SEE ALSO

Your application can obtain the current hue value by calling the VDGetHue function (described in the next section). To retrieve the recommended hue value, your application can call the VDGetVideoDefaults function (described on VDGetVideoDefaults ).

VDGetHue

The VDGetHue function returns the current hue value. Hue is similar to the tint control on a television, and it is specified in degrees with complementary colors set 180 degrees apart (red is 0°, green is +120°, and blue is -120°). Video digitizer components support hue values that range from 0 (-180° shift in hue) to 65,535 (+179° shift in hue), where 32,767 represents a 0° shift in hue.

pascal VideoDigitizerError VDGetHue (VideoDigitizerComponent ci,
                                          unsigned short *hue);
ci
Specifies the video digitizer component for the request. Applications obtain this reference from the Component Manager's OpenComponent function.
hue
Contains a pointer to an integer that is to receive the current hue value. The video digitizer component places the hue value into the field referred to by this parameter.

RESULT CODES

noErr

0

No error

digiUnimpErr

-2201

Function not supported

SEE ALSO

Your application can set the hue value by calling the VDSetHue function (described in the previous section). To obtain the recommended hue value, your application can call the VDGetVideoDefaults function (described on VDGetVideoDefaults ).

VDSetSaturation

The VDSetSaturation function sets the saturation value, which controls color intensity. For example, at high saturation levels, red appears to be red; at low saturation, red appears pink. Valid saturation values range from 0 to 65,535, where 0 is the minimum saturation value and 65,535 specifies maximum saturation.

pascal VideoDigitizerError VDSetSaturation
                                          (VideoDigitizerComponent ci,
                                         unsigned short *saturation);
ci
Specifies the video digitizer component for the request. Applications obtain this reference from the Component Manager's OpenComponent function.
saturation
Contains a pointer to an integer that contains the new saturation value. The video digitizer component attempts to set the saturation value to the value specified by this parameter. The digitizer component returns the new value, so that the application can avoid using unsupported values in future requests.

RESULT CODES

noErr

0

No error

digiUnimpErr

-2201

Function not supported

qtParamErr

-2202

Invalid parameter value

SEE ALSO

Applications can get the current saturation value by calling the VDGetSaturation function (described in the next section). Applications can obtain the recommended saturation value by calling the VDGetVideoDefaults function (described on VDGetVideoDefaults ).

VDGetSaturation

The VDGetSaturation function returns the current saturation value, which controls color intensity. For example, at high saturation levels red appears to be red, while at low saturation red appears pink. Valid saturation values range from 0 to 65,535, where 0 is the minimum saturation value and 65,535 specifies maximum saturation.

pascal VideoDigitizerError VDGetSaturation
                                         (VideoDigitizerComponent ci,
                                          unsigned short *saturation);
ci
Specifies the video digitizer component for the request. Applications obtain this reference from the Component Manager's OpenComponent function.
saturation
Contains a pointer to an integer that is to receive the current saturation value. The video digitizer component places the saturation value into the field referred to by this parameter.

DESCRIPTION

The VDGetSaturation function returns the current saturation value.

RESULT CODES

noErr

0

No error

digiUnimpErr

-2201

Function not supported

SEE ALSO

Your application can set the saturation value by calling the VDSetSaturation function (described in the previous section). To obtain the recommended saturation value, your application can call the VDGetVideoDefaults function (described on VDGetVideoDefaults ).

VDSetBrightness

The VDSetBrightness function sets the current brightness value, which controls the overall brightness of the digitized video image. Brightness values range from 0 to 65,535, where 0 is the darkest possible setting and 65,535 is the lightest possible setting.

pascal VideoDigitizerError VDSetBrightness
                                          (VideoDigitizerComponent ci,
                                         unsigned short *brightness);
ci
Specifies the video digitizer component for the request. Applications obtain this reference from the Component Manager's OpenComponent function.
brightness
Contains a pointer to an integer that contains the new brightness value. The video digitizer component attempts to set the brightness value to the value specified by this parameter. The digitizer component returns the new value, so that the application can avoid using unsupported values in future requests.

RESULT CODES

noErr

0

No error

digiUnimpErr

-2201

Function not supported

SEE ALSO

Your application can get the current brightness value by calling the VDGetBrightness function (described in the next section). To obtain the recommended brightness value, your application can call the VDGetVideoDefaults function (described on VDGetVideoDefaults ).

VDGetBrightness

The VDGetBrightness function returns the current brightness value, which reflects the overall brightness of the digitized video image. Brightness values range from 0 to 65,535, where 0 is the darkest possible setting and 65,535 is the lightest possible setting.

pascal VideoDigitizerError VDGetBrightness
                                          (VideoDigitizerComponent ci,
                                          unsigned short *brightness);
ci
Specifies the video digitizer component for the request. Applications obtain this reference from the Component Manager's OpenComponent function.
brightness
Contains a pointer to an integer that is to receive the current brightness value. The video digitizer component places the brightness value into the field referred to by this parameter.

RESULT CODES

noErr

0

No error

digiUnimpErr

-2201

Function not supported

SEE ALSO

Your application can set the brightness value by calling the VDSetBrightness function (described in the previous section). To obtain the recommended brightness value, your application can call the VDGetVideoDefaults function (described on VDGetVideoDefaults ).

VDSetContrast

The VDSetContrast function sets the current contrast value. The contrast value ranges from 0 to 65,535, where 0 represents no change to the basic image and larger values increase the contrast of the video image (that is, increase the slope of the transform).

pascal VideoDigitizerError VDSetContrast
                                          (VideoDigitizerComponent ci,
                                          unsigned short *contrast);
ci
Specifies the video digitizer component for the request. Applications obtain this reference from the Component Manager's OpenComponent function.
contrast
Contains a pointer to an integer that contains the new contrast value. The video digitizer component attempts to set the contrast value to the value specified by this parameter. The digitizer component returns the new value, so that the application can avoid using unsupported values in future requests.

RESULT CODES

noErr

0

No error

digiUnimpErr

-2201

Function not supported

qtParamErr

-2202

Invalid parameter value

SEE ALSO

Your application can obtain the current contrast value by calling the VDGetContrast function (described in the next section). To retrieve the recommended contrast value, your application can call the VDGetVideoDefaults function (described on VDGetVideoDefaults ).

VDGetContrast

The VDGetContrast function returns the current contrast value. The contrast value ranges from 0 to 65,535, where 0 represents no change to the basic image and larger values increase the contrast of the video image (that is, increase the slope of the transform).

pascal VideoDigitizerError VDGetContrast
                                         (VideoDigitizerComponent ci,
                                          unsigned short *contrast);
ci
Specifies the video digitizer component for the request. Applications obtain this reference from the Component Manager's OpenComponent function.
contrast
Contains a pointer to an integer that is to receive the current contrast value. The video digitizer component places the contrast value into the field referred to by this parameter.

RESULT CODES

noErr

0

No error

digiUnimpErr

-2201

Function not supported

SEE ALSO

Your application can set the contrast value by calling the VDSetContrast function (described in the previous section). To obtain the recommended contrast value, your application can call the VDGetVideoDefaults function (described on VDGetVideoDefaults ).

VDSetSharpness

The VDSetSharpness function sets the sharpness value. The sharpness value ranges from 0 to 65,535, where 0 represents no sharpness filtering and 65,535 represents full sharpness filtering. Higher values result in a visual impression of increased picture sharpness.

pascal VideoDigitizerError VDSetSharpness
                                         (VideoDigitizerComponent ci,
                                          unsigned short *sharpness);
ci
Specifies the video digitizer component for the request. Applications obtain this reference from the Component Manager's OpenComponent function.
sharpness
Contains a pointer to an integer that contains the new sharpness value. The video digitizer component attempts to set the sharpness value to the value specified by this parameter. The digitizer component returns the new value, so that the application can avoid using unsupported values in future requests.

RESULT CODES

noErr

0

No error

digiUnimpErr

-2201

Function not supported

qtParamErr

-2202

Invalid parameter value

SEE ALSO

Your application can obtain the current sharpness value by calling the VDGetSharpness function (described in the next section). To retrieve the recommended sharpness value, your application can call the VDGetVideoDefaults function (described on VDGetVideoDefaults ).

VDGetSharpness

The VDGetSharpness function returns the current sharpness value. The sharpness value ranges from 0 to 65,535, where 0 represents no sharpness filtering and 65,535 represents full sharpness filtering. Higher values result in a visual impression of increased picture sharpness.

pascal VideoDigitizerError VDGetSharpness
                                         (VideoDigitizerComponent ci,
                                          unsigned short *sharpness);
ci
Specifies the video digitizer component for the request. Applications obtain this reference from the Component Manager's OpenComponent function.
sharpness
Contains a pointer to an integer that is to receive the current sharpness value. The video digitizer component places the sharpness value into the field referred to by this parameter.

RESULT CODES

noErr

0

No error

digiUnimpErr

-2201

Function not supported

SEE ALSO

Your application can set the sharpness value by calling the VDSetSharpness function (described in the previous section). To obtain the recommended sharpness value, your application can call the VDGetVideoDefaults function (described on VDGetVideoDefaults ).

VDSetInputGammaRecord

The VDSetInputGammaRecord function allows an application to change the active input gamma data structure. Gamma structures give applications complete control over color filtering transforms.

pascal VideoDigitizerError VDSetInputGammaRecord
                                          (VideoDigitizerComponent ci,
                                         VDGamRecPtr inputGammaPtr);
ci
Specifies the video digitizer component for the request. Applications obtain this reference from the Component Manager's OpenComponent function.
inputGammaPtr
Contains a pointer to an input gamma structure. The input gamma structure is defined by the gammaTbl data type. For more information about gamma structures, see Designing Cards and Drivers for the Macintosh Family , third edition. The video digitizer component uses the input gamma structure specified by this parameter.

SPECIAL CONIDERATIONS

Note that the VDSetInputGammaRecord function may override the current gamma value and contrast settings if the video digitizer component uses a lookup table to implement brightness and contrast.

RESULT CODES

noErr

0

No error

digiUnimpErr

-2201

Function not supported

SEE ALSO

Your application can get a pointer to the current input gamma structure by calling the VDGetInputGammaRecord function, which is described in the next section.

VDGetInputGammaRecord

The VDGetInputGammaRecord function allows your application to retrieve a pointer to the active input gamma structure. Gamma structures give applications complete control over color filtering transforms and are therefore more precise than the gamma values that can be set by calling the VDSetInputGammaValue function (described in the next section).

pascal VideoDigitizerError VDGetInputGammaRecord
                                          (VideoDigitizerComponent ci,
                                          VDGamRecPtr *inputGammaPtr);
c i
Specifies the video digitizer component for the request. Applications obtain this reference from the Component Manager's OpenComponent function.
inputGammaPtr
Contains a pointer to a field that is to receive a pointer to an input gamma structure. The input gamma structure is defined by the gammaTbl data type. For more information about gamma structures, see Designing Cards and Drivers for the Macintosh Family , third edition. The video digitizer component places a pointer to its input gamma structure into the field referred to by this parameter.

RESULT CODES

noErr

0

No error

digiUnimpErr

-2201

Function not supported

SEE ALSO

Your application can set the input gamma structure by calling the VDSetInputGammaRecord function, which is described in the previous section.

VDSetInputGammaValue

The VDSetInputGammaValue function sets the gamma values. These gamma values control the brightness of the input video signal. Your application can implement special color effects, such as turning off specific color channels, by calling this function.

pascal VideoDigitizerError VDSetInputGammaValue
                                          (VideoDigitizerComponent ci,
                                         Fixed channel1,
                                         Fixed channel2,
                                         Fixed channel3);
ci
Specifies the video digitizer component for the request. Applications obtain this reference from the Component Manager's OpenComponent function.
channel1
Specifies the gamma value for the red component of the input video signal.
channel2
Specifies the gamma value for the green component of the input video signal.
channel3
Specifies the gamma value for the blue component of the input video signal.

RESULT CODES

noErr

0

No error

digiUnimpErr

-2201

Function not supported

SEE ALSO

Your application can retrieve the current gamma values by calling the VDGetInputGammaValue function (described in the next section). To obtain the recommended gamma values, your application can call the VDGetVideoDefaults function (described on VDGetVideoDefaults ).

VDGetInputGammaValue

The VDGetInputGammaValue function returns the current gamma values. These gamma values control the brightness of the input video signal.

pascal VideoDigitizerError VDGetInputGammaValue
                                         (VideoDigitizerComponent ci,
                                          Fixed *channel1, Fixed *channel2,
                                          Fixed *channel3);
ci
Specifies the video digitizer component for the request. Applications obtain this reference from the Component Manager's OpenComponent function.
channel1
Contains a pointer to a fixed field that is to receive the gamma value for the red component of the input video signal. The video digitizer component places the appropriate gamma value into the field referred to by this parameter.
channel2
Contains a pointer to a fixed field that is to receive the gamma value for the green component of the input video signal. The video digitizer component places the appropriate gamma value into the field referred to by this parameter.
channel3
Contains a pointer to a fixed field that is to receive the gamma value for the blue component of the input video signal. The video digitizer component places the appropriate gamma value into the field referred to by this parameter.

RESULT CODES

noErr

0

No error

digiUnimpErr

-2201

Function not supported

SEE ALSO

Your application can set the gamma values by calling the VDSetInputGammaValue function (described in the previous section). To obtain the recommended gamma values, you can call the VDGetVideoDefaults function (described on VDGetVideoDefaults ).


© 1997 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next